/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2020-08-30 22:59:10
 * @LastEditors: voanit
 * @LastEditTime: 2022-01-03 10:15:50
 */
import request from '@/utils/request'

export function loginApi(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data: data,
  })
}
// login({mobile:111,password:123456})

/* 获取用户信息 */
/**
 * @description: 获取用户资料
 * @param {*}
 * @return {Promise}
 */
export function getInfoApi() {
  return request({
    url: '/sys/profile',
    method: 'post',
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post',
  })
}

/**
 * @description: 获取用户头像
 * @param {*} id 用户id
 * @return {*}
 */
export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`,
  })
}
